package com.yc.springmvc.bean;

import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.*;
import java.sql.Timestamp;
import java.util.List;

@Data
public class Movie implements java.io.Serializable{
    private Integer id;
    @NotBlank(message = "片名不能为空")
    private String name;
    @Range(min = 30,max = 600,message = "片长必须在30-600分钟")
    private Integer length;
    private String type;
    @Past  //过去的时间
    private Timestamp beginTime;
    @Future  //未来的时间
    private Timestamp endTime;
    private Boolean is3d;
    private String intro;
    @Pattern(regexp = "[/\\w]+\\.\\w+" , message = "图片格式错误  ")
    @Size(min = 5,max = 100,message = "图片地址长度必须在5-100个字符之间")
    private String image;

    //一对多关联
    private List<Plan> plans;
}
